import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '功能名称',
    align: "center",
    dataIndex: 'functionName'
  },
  {
    title: '测试方法',
    align: "center",
    sorter: true,
    dataIndex: 'testMethod'
  },
  {
    title: '案例性质',
    align: "center",
    sorter: true,
    dataIndex: 'caseNature'
  },
  {
    title: '测试目的',
    align: "center",
    dataIndex: 'caseName'
  },
  {
    title: '前提条件',
    align: "center",
    dataIndex: 'prerequisite'
  },
  {
    title: '数据需求',
    align: "center",
    dataIndex: 'dataRequire'
  },
  {
    title: '操作步骤',
    align: "center",
    dataIndex: 'description'
  },
  {
    title: '预期结果',
    align: "center",
    dataIndex: 'expectResult'
  },
  {
    title: '用例状态',
    align: "center",
    dataIndex: 'caseStatus_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "功能名称",
    field: 'functionName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "测试方法",
    field: 'testMethod',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "案例性质",
    field: 'caseNature',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "测试目的",
    field: 'caseName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "用例状态",
    field: 'caseStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "gen_case_status"
    },
    //colProps: {span: 6},
  },
  {
    label: "创建人",
    field: 'createBy',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '功能名称',
    field: 'functionName',
    component: 'Input',
  },
  {
    label: '测试方法',
    field: 'testMethod',
    component: 'Input',
  },
  {
    label: '案例性质',
    field: 'caseNature',
    component: 'Input',
  },
  {
    label: '测试目的',
    field: 'caseName',
    component: 'InputTextArea',
  },
  {
    label: '前提条件',
    field: 'prerequisite',
    component: 'InputTextArea',
  },
  {
    label: '数据需求',
    field: 'dataRequire',
    component: 'InputTextArea',
  },
  {
    label: '操作步骤',
    field: 'description',
    component: 'InputTextArea',
  },
  {
    label: '预期结果',
    field: 'expectResult',
    component: 'InputTextArea',
  },
  {
    label: '用例状态',
    field: 'caseStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "gen_case_status"
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  functionName: {title: '功能名称',order: 0,view: 'text', type: 'string',},
  testMethod: {title: '测试方法',order: 1,view: 'text', type: 'string',},
  caseNature: {title: '案例性质',order: 2,view: 'text', type: 'string',},
  caseName: {title: '测试目的',order: 3,view: 'textarea', type: 'string',},
  prerequisite: {title: '前提条件',order: 4,view: 'textarea', type: 'string',},
  dataRequire: {title: '数据需求',order: 5,view: 'textarea', type: 'string',},
  description: {title: '操作步骤',order: 6,view: 'textarea', type: 'string',},
  expectResult: {title: '预期结果',order: 7,view: 'textarea', type: 'string',},
  caseStatus: {title: '用例状态',order: 8,view: 'list', type: 'string',dictCode: 'gen_case_status',},
};
